//
//  TMP.swift
//  TTCOM
//
//  Created by Toj on 10/21/22.
//

import Foundation

///** 将字符串拼接成完整的url格式http://...... */
//private var supplementaryToFullPathHttpURLString: NSString {
//    let httpHeader = "http:"
//    let httpsHeader = "https:"
//    // http 开头直接返回
//    if hasPrefix(httpHeader) {
//        return self
//    }
//
//    // https 开头替换 http
//    if hasPrefix(httpsHeader) {
//        return stringByReplacingOccurrencesOfString(httpsHeader, withString: httpHeader)
//    }
//
//    if hasPrefix("//") {
//        return httpHeader + (self as String)
//    }
//
//    // 其他情况
//    return httpHeader + "//" + (self as String)
//}
//
///** 将字符串拼接成完整的url格式https://...... */
//private var supplementaryToFullPathHttpsURLString: NSString {
//    let httpHeader = "http:"
//    let httpsHeader = "https:"
//    // https 开头直接返回
//    if hasPrefix(httpsHeader) {
//        return self
//    }
//
//    // http 开头替换 https
//    if hasPrefix(httpHeader) {
//        return stringByReplacingOccurrencesOfString(httpHeader, withString: httpsHeader)
//    }
//
//    // // 开头加入https:
//    if hasPrefix("//") {
//        return httpsHeader + (self as String)
//    }
//
//    // 其他情况
//    return httpsHeader + "//" + (self as String)
//}
//
///**
// 将url拼接成完整格式
// - parameter usingHttps: 是否是https
//
// - returns: url完整路径
// */
//func supplementaryToFullPathURLString(usingHttps: Bool) -> NSString {
//
//    return usingHttps ? supplementaryToFullPathHttpsURLString : supplementaryToFullPathHttpURLString
//}
